import Vue from "vue";
import VueRouter from "vue-router";
import Home from "@/views/Home";
import Input from "@/views/Input";
import Main from "@/views/Main";
import Output from "@/views/Output";
import Return from "@/views/Return";
import Fix from "@/views/Fix";
import Rework from "@/views/Rework";
import Out from "@/views/Out";
import Device from "@/views/Device";
import Check from "@/views/Check";
import Box from "@/views/Box";
import Login from "@/views/Login";
import User from "@/views/User";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Main,
    redirect: '/login',
    children: [
      {
        path: 'Home',
        component: Home
      },
      {
        path: 'Input',
        component: Input
      },
      {
        path: 'Output',
        component: Output
      },
      {
        path: 'Return',
        component: Return
      },
      {
        path: 'Fix',
        component: Fix
      },
      {
        path: 'Rework',
        component: Rework
      },
      {
        path: 'Check',
        component: Check
      },
      {
        path:'Box',
        component: Box
      },
      {
        path: 'Out',
        component: Out
      },
      {
        path: 'Device',
        component: Device
      },
      {
        path: 'User',
        component: User
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  routes // (缩写) 相当于 routes: routes
})

export default router

